#!/bin/sh
#
# init_all.sh
#
superuser=$1
installation_directory=$2

su $superuser -c "
    cp ~/.bashrc ~/.bashrc.org;
        cat > ~/.bashrc <<EOF;
        export PATH_ORG=\$PATH
        export PATH=$installation_directory/bin:\$PATH
        export LD_LIBRARY_PATH_ORG=\$LD_LIBRARY_PATH
        export LD_LIBRARY_PATH=$installation_directory/lib:\$LD_LIBRARY_PATH
        export MANPATH_ORG=\$MANPATH
        export MANPATH=$installation_directory/share/man:\$MANPATH
EOF
        cat ~/.bashrc.org >> ~/.bashrc
        "

if [ $? -ne 0 ]; then
        exit 100
fi

exit 0

